#ifndef __SET_GET_H__
#define __SET_GET_H__

#include "repeat.h"

#define DECL_WITH_SET_GET(var, type)           \
  private:                                     \
    type var##_;                               \
                                               \
  public:                                      \
    const type& var() const { return var##_; } \
    type& var##_ref() { return var##_; }       \
    void set_##var(type new_var) { var##_ = new_var; }

#define DECL_WITH_SET_GET_MODIFIER(modifier, var, type) \
    modifier:                                           \
    type var##_;                                        \
                                                        \
  public:                                               \
    const type& var() const { return var##_; }          \
    type& var##_ref() { return var##_; }                \
    void set_##var(type new_var) { var##_ = new_var; }

#endif  // __SET_GET_H__